There has been an increasing trend in the data amount of structured documents in XML and the like, and the structured documents are thus not suitable for high-speed data processing and processing handling a large amount of XML documents. Efficient XML Interchange (EXI) is therefore proposed as a standard for efficient and high-speed data processing. The EXI converts an XML document to an EXI stream that is a binarized representation according to the XML schema. This can contribute to efficient data communication and processing since binarized data are dramatically reduced in data volume.
Furthermore, for actually checking data binarized as described above by a user, the user inputs the EXI stream to a decoding device having the same logic as that of a state machine used to binarize the XML document and the original XML document is output therefrom. Since the output XML document is written in a human-readable format, the user can thus check the content thereof.
In order to properly handle a structured document converted to an EXI stream as described above, it is necessary that the decoding device work properly. It is thus desirable to conduct a test using an EXI stream generated from an XML document as input to check whether or not decoding is successful before the decoding device is put into operation. Since, however, there are infinite patterns of input XML documents, the operation of a decoding device cannot be guaranteed by simply using an EXI stream generated from an XML document as input as test data.
A verification device according to an embodiment includes a receiving unit, an encoding rule generating unit, a test data generating unit, an error rule generating unit, a determined value generating unit, and a verifying unit. The encoding rule generating unit generates an encoding rule defining state transitions on the basis of a definition document.
The test data generating unit generates test data according to the encoding rule. The error rule generating unit adds an error rule to the encoding rule when there is a difference between the number of state transitions and the maximum number that can be expressed by the number of bits necessary for expressing the number of transitions, the error rule corresponding to the difference. The determined value generating unit generates a determined value indicating whether a transition is a normal transition or an abnormal transition for each of the combinations of the state transitions in accordance with the encoding rule.
The verifying unit compares an output determined value resulting from inputting the test data to the decoding device with the determined value, and determines that the decoding device is not normal when the output determined value and the determined value are different from each other.